//
//  NavView.m
//  BeautyPicture
//
//  Created by 沈振邦 on 15/11/14.
//  Copyright © 2015年 szb. All rights reserved.
//

#import "NavView.h"

@implementation NavView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _navImage = [[UIImageView alloc] initWithFrame:CGRectMake(-8, 13, 17, 15)];
        _navImage.image = [UIImage imageNamed:@"返回"];
        [self addSubview:_navImage];

        _navLabel = [[UILabel alloc] initWithFrame:CGRectMake(13.0, 13, 77, 15)];
        _navLabel.font = [UIFont systemFontOfSize:15.0f];
        _navLabel.textColor = [UIColor whiteColor];
        [self addSubview:_navLabel];
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backVC:)];
        [self addGestureRecognizer:tap];
    }
    return self;
}

- (void)backVC:(UITapGestureRecognizer *)sender
{
    if ([self.delegate respondsToSelector:@selector(navTap:)]) {
        [self.delegate navTap:sender];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
